package com.ziyueyuwen.xiniao.util;


import com.github.pagehelper.PageInfo;
import com.ziyueyuwen.xiniao.bean.page.PageData;

/**
 * @author wancheng  on 2018/8/27.
 */
public class PageDataUtil {
    public static PageData getPageData(PageInfo pageInfo) {
        PageData pageData = new PageData();
        pageData.setPage(pageInfo.getPageNum());
        pageData.setRows(pageInfo.getPageSize());
        pageData.setTotal(pageInfo.getTotal());
        pageData.setData(pageInfo.getList());
        pageData.setTotalPage(pageInfo.getPages());
        return pageData;
    }
}
